<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>合同维护</title>
<%@include file="/skins/jsp/loadCss.jsp"%>
<style>
.ch-g1-2,.ch-g1-4 {
	display: inline-block;
	vertical-align: top;
}

.ch-g1-2 {
	width: 49%;
}

.ch-g1-4 {
	width: 24%;
}
</style>
<script type="text/javascript">
		var showCustomerWin=function(){
			var strs =window.showModalDialog("<%=request.getContextPath()%>/contract/showCustomerWin.action",{},"dialogWidth=760px;dialogHeight=400px;status:no;help:no;");
			if(strs){
				var stra = strs.split(';');
				$('#a_company_cttAId').val(stra[0]);
				$('#a_company').val(stra[1]);
			}
		};
	</script>
</head>
<body>
	<%@include file="/skins/jsp/loadJquery.jsp"%>
	<script type="text/javascript">
	</script>
	<h2>合同信息维护</h2>
	<p class="ch-form-hint">以下带‘ * ’的项为必填项</p>
	<s:iterator value="model">
		<s:form cssClass="YOUR_SELECTOR_Formcountdown ch-form" id="c-form"
			action="saveContract" namespace="/contract" method="post">
			<fieldset>
				<legend>客户信息</legend>
				<p class="ch-form-row ch-form-required">
					<label for="cttNo">合同号: <em>*</em> </label>
					<s:hidden name="cttId"></s:hidden>
					<s:textfield id="cttNo" name="cttNo" required="required"></s:textfield>
				</p>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cttSArea">发货区域: </label>
						<s:select id="cttSArea" name="cttSArea"
							list="#{'000':'未知','SH':'上海','BJ':'北京','TJ':'天津','CQ':'重庆','AH':'安徽','FJ':'福建','GD':'广东','GX':'广西','GS':'甘肃','GZ':'贵州','HEB':'河北','HEN':'河南','HAIN':'海南','HUB':'湖北','HUN':'湖南','HLJ':'黑龙江','JL':'吉林','LN':'辽宁','JS':'江苏','JX':'江西','NMG':'内蒙古','NX':'宁夏','QH':'青海','SC':'四川','SHAND':'山东','SHANX':'山西','SANX':'陕西','XJ':'新疆','XZ':'西藏','YN':'云南','ZJ':'浙江'}"></s:select>
					</p>
					<p class="ch-form-row">
						<label for="cttRArea">客户区域: </label>
						<s:select id="cttRArea" name="cttRArea"
							list="#{'000':'未知','SH':'上海','BJ':'北京','TJ':'天津','CQ':'重庆','AH':'安徽','FJ':'福建','GD':'广东','GX':'广西','GS':'甘肃','GZ':'贵州','HEB':'河北','HEN':'河南','HAIN':'海南','HUB':'湖北','HUN':'湖南','HLJ':'黑龙江','JL':'吉林','LN':'辽宁','JS':'江苏','JX':'江西','NMG':'内蒙古','NX':'宁夏','QH':'青海','SC':'四川','SHAND':'山东','SHANX':'山西','SANX':'陕西','XJ':'新疆','XZ':'西藏','YN':'云南','ZJ':'浙江'}"></s:select>
					</p>
				</div>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cttClass">合同种类: </label>
						<s:select id="cttClass" name="cttClass"
							list="#{'1':'普通合同','2':'样品赠送','3':'样品外借'}"></s:select>
					</p>
					<p class="ch-form-row">
						<label for="cttType">合同类型: </label>
						<s:select id="cttType" name="cttType"
							list="#{'1':'普通定单'}"></s:select>
					</p>
				</div>
				<p class="ch-form-row ch-form-required">
					<label for="a_company">合同公司: <em>*</em> </label>
					<s:hidden name="cttAId" id="a_company_cttAId"></s:hidden>
					<s:textfield id="a_company" name="cctCustomer" size="80"></s:textfield>
					<a onclick="showCustomerWin();" class="ch-btn ch-btn-small ch-btn-skin">选择</a>
				</p>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cctCLinkName">客户联系人: </label> <s:textfield id="cctCLinkName" name="cctCLinkName" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="cctCLinkFax">传真: </label> <s:textfield id="cctCLinkFax" name="cctCLinkFax" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="cctCLinkGAddress">货物接收地址: </label> <s:textfield id="cctCLinkGAddress" name="cctCLinkGAddress" size="30"></s:textfield>
					</p>
				</div>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cctCLinkPhoto">联系电话: </label> <s:textfield id="cctCLinkPhoto" name="cctCLinkPhoto" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="cctCLinkEmail">E-mail: </label> <s:textfield id="cctCLinkEmail" name="cctCLinkEmail" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="cctCLinkIAddress">发票接收地址: </label> <s:textfield id="cctCLinkIAddress" name="cctCLinkIAddress" size="30"></s:textfield>
					</p>
				</div>
			</fieldset>
			<fieldset>
				<legend>合同信息</legend>
				<p class="ch-form-row ch-form-required">
					<label for="cttBUserName">公司联系人: <em>*</em> </label>
					<s:hidden name="cttBUser" id="cttBUser"></s:hidden>
					<s:textfield id="cttBUserName" name="cttBUserName" size="80"></s:textfield>
					<s:a action="findUsersWin" namespace="/system"
						cssClass="ch-btn ch-btn-small ch-btn-skin YOUR_SELECTOR_User_Modal">选择</s:a>
				</p>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cttCm">运费: </label>
						<s:textfield id="cttCm" name="cttCm" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="payMode">付款方式: </label>
						<s:select id="payMode" name="payMode"
							list="#{'00':'先货后款','01':'10%预付','02':'20%预付','03':'30%预付','04':'40%预付','05':'50%预付','06':'60%预付','07':'70%预付','08':'80%预付','09':'90%预付','10':'100%预付','11':'先预付再尾款再货','12':'先开发票再款再货','13':'先开发票再货再款','14':'样品外借须押金','15':'样品外借无押金'}"></s:select>
					</p>
					<p class="ch-form-row">
						<label for="imprest">预付款: </label>
						<s:textfield id="imprest" name="imprest" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="accountDate">帐期时间: </label>
						<s:textfield id="accountDate" name="accountDate" size="30"></s:textfield>
						天
					</p>
					<p class="ch-form-row">
						<label for="futures">期货: </label>
						<s:textfield id="futures" name="futures" size="30"></s:textfield>
						工作日
					</p>
				</div>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="cttFm">预估运费: </label>
						<s:textfield id="cttFm" name="cttFm" size="30"></s:textfield>
					</p>
					<p class="ch-form-row">
						<label for="mClass">货币种类: </label>
						<s:select id="mClass" name="moneyClass"
							list="#{'RMB':'RMB','USD':'USD','GBP':'GBP','HKD':'HKD','JPY':'JPY','EUR':'EUR','SGD':'SGD'}"></s:select>
					</p>
					<p class="ch-form-row">
						<label for="invoiceClass">发票类型: </label>
						<s:select id="invoiceClass" name="invoiceClass"
							list="#{'05':'17%增值税发票','09':'17%普通发票','11':'普通发票','12':'开收据','13':'不开发票,不开收据'}"></s:select>
					</p>
					<p class="ch-form-row">
						<label for="comKind">公司性质: </label>
						<s:select id="comKind" name="comKind"
							list="#{'1':'未知','2':'客户','3':'分销'}"></s:select>
					</p>
				</div>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="sRemark">发货要求: </label>
						<s:textarea id="sRemark" name="sendRemark"></s:textarea>
					</p>
					<p class="ch-form-row">
						<label for="iRemark">发票备注: </label>
						<s:textarea id="iRemark" name="invRemark"></s:textarea>
					</p>
				</div>
				<div class="ch-g1-2">
					<p class="ch-form-row">
						<label for="remark">备注: </label>
						<s:textarea id="remark" name="remark"></s:textarea>
					</p>
					<p class="ch-form-row">
						<label for="addRemark">附加条款: </label>
						<s:textarea id="addRemark" name="addRemark"></s:textarea>
					</p>
				</div>
				<p class="ch-form-row">
					<label for="life">合同有效期: </label>
					<s:textfield id="life" name="life"></s:textfield>
				</p>
			</fieldset>
			<p class="ch-form-actions">
				<s:submit cssClass="ch-btn ch-primary" value="确认"></s:submit>
				<s:reset class="ch-btn ch-primary" value="重置"></s:reset>
				<s:a cssClass="ch-btn ch-btn-small" action="findContracts"
					namespace="/contract">后退</s:a>
			</p>
		</s:form>
	</s:iterator>
	<script type="text/javascript">
		var coform = $('#c-form').form(), ch_moda = $(".YOUR_SELECTOR_Modal")
				.modal({
					"width" : "600px",
					"height" : "500px",
					"cache" : false
				}), inv_moda = $(".YOUR_SELECTOR_Inv_Modal").modal({
			"width" : "600px",
			"height" : "500px",
			"cache" : false
		}), user_moda = $(".YOUR_SELECTOR_User_Modal").modal({
			"width" : "600px",
			"height" : "500px",
			"cache" : false
		}), sr = $('#sRemark').countdown({
			max : 250,
			plural : '剩余字符数:#'
		}), ir = $('#iRemark').countdown({
			max : 250,
			plural : '剩余字符数:#'
		}), lifed = $("#life").datePicker(
				{
					monthsNames : [ "一月", "二月", "三月", "四月", "五月", "六月", "七月",
							"八月", "九月", "十月", "十一月", "十二月" ],
					weekdays : [ "日", "一", "二", "三", "四", "五", "六" ]
				}), selectCustom = function(ctId, ctName, ctPhoto, ctBank,
				ctAccounts, ctPost) {
			$('#a_company_cttAId').val(ctId);
			$('#a_company').val(ctName);
			ch_moda.hide();
		}, selectUser = function(userId, userName) {
			$('#cttBUser').val(userId);
			$('#cttBUserName').val(userName);
			user_moda.hide();
		};
	</script>
</body>
</html>